package sen.myReport;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MyReportDataFactory {

	private static final Logger LOG = LoggerFactory.getLogger(MyReportDataFactory.class);
	
	private MyReportDataFactory(){}
	
	/**
	 * 据所有报表的名称产生报表对象的List
	 * @param reportNames
	 * @return
	 */
	public Map<String, MyReportData> getAllMyReports(List<MyReportData> reportNames) {
		Map<String, MyReportData> m = new HashMap<String, MyReportData>();
		for (int i = 0; i < reportNames.size(); i++) {
			MyReportData r = reportNames.get(i);
			m.put(r.getReqReportId(), r);
		}
		return m;
	}
	
	private static MyReportDataFactory df = null;
	public static MyReportDataFactory createInstance() {
		if(null==df) {
			df = new MyReportDataFactory();
		}
		return df;
	}
}